package com.pactera.homework.first.method2;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: TODO
 * @Author: hejiayao
 * @CreateDate: 2022/12/8 15:42
 * @UpdateUser: hejiayao
 * @UpdateDate: 2022/12/8 15:42
 * @className: PhoneConfig
 * @Package : com.pactera.homework.first
 * @Version: 1.0
 */
@Configuration
public class PhoneConfig {
    @Bean
    @Qualifier("p30")
    public P30Phone p30Phone() {
        return new P30Phone();
    }

    @Bean
    @Qualifier("mete30")
    public Mete30Phone mete30Phone() {
        return new Mete30Phone();
    }

    @Bean(name = "lihua")
    public Somebody somebody() {
        return new Somebody(mete30Phone());
    }

    @Bean(name = "xiaoming")
    public Somebody someone(@Qualifier("p30") HWPhone phone) {
        return new Somebody(phone);
    }
}
